# coding:utf-8
import pytesseract
from PIL import Image


class TesseractDemo:
    def _test_image(self):
        """
        td = TesseractDemo()
        td._test_image()
        """
        pytesseract.pytesseract.tesseract_cmd = "C:/Users/lz/AppData/Local/Tesseract-OCR/tesseract"
        im = Image.open('./ext/cTesseract/tesseract.jpg')
        print(im)
        data = pytesseract.image_to_string(im)
        print(data)


if __name__ == '__main__':
    td = TesseractDemo()
    td._test_image()
